package com.yc.sole.common.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yizuomin
 * @date 2023/3/20 10:17
 **/
@Getter
@AllArgsConstructor
public enum CommonState implements IBaseEnum<String> {

    /**
     *
     */
    DISABLE("0", "禁用"),
    ENABLE("1", "可用");

    @JsonValue
    private final String value;
    private final String description;

    /**
     * @param value
     * @return
     */
    public static CommonState getByValue(String value) {
        for (CommonState commonState : CommonState.values()) {
            if (commonState.value.equals(value)) {
                return commonState;
            }
        }
        return null;
    }
}
